package cn.itcast.filter16.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.http.HttpSessionListener;
import javax.servlet.ServletRequestListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.http.HttpSessionEvent;

public abstract class MyListener implements
        ServletContextListener, HttpSessionListener, ServletRequestListener {

    // ServletContext监听方法
    public void contextInitialized(ServletContextEvent arg0) {
        System.out.println("ServletContext对象被创建了");
    }

    public void contextDestroyed(ServletContextEvent arg0) {
        System.out.println("ServletContext对象被销毁了");
    }

    // HttpSession监听方法
    public void sessionCreated(HttpSessionEvent arg0) {
        // 实现session创建监听逻辑
    }

    public void sessionDestroyed(HttpSessionEvent arg0) {
        // 实现session销毁监听逻辑
    }

    // ServletRequest监听方法
    public void requestInitialized(ServletRequestEvent arg0) {
        // 实现request初始化监听逻辑
    }

    public void requestDestroyed(ServletRequestEvent arg0) {
        // 实现request销毁监听逻辑
    }
}